class Book:
    def __init__(self, title, author, pages):
        self.title = title
        self.author = author
        self.pages = pages

    def info(self):
        return f'《{self.title}》 by {self.author}, 页数: {self.pages} 页'


class Bookshelf:
    def __init__(self):
        self.books = []

    def add_book(self, book):
        self.books.append(book)

    def list_books(self):
        for book in self.books:
            print(book.info())

    def find_book_by_title(self, title):
        for book in self.books:
            if book.title == title:
                return book.info()
        return '未找到书籍'


def main():
    bookshelf = Bookshelf()

    num_books = 3
    for i in range(num_books):
        title = input(f'请输入第 {i + 1} 本书的书名: ')
        author = input(f'请输入第 {i + 1} 本书的作者: ')
        pages = int(input(f'请输入第 {i + 1} 本书的页数: '))
        book = Book(title, author, pages)
        bookshelf.add_book(book)

    # 显示书架上所有书籍的详细信息
    print("\n书架上所有书籍的详细信息:")
    bookshelf.list_books()

    # 让用户输入书名查找书籍，并显示查找结果
    search_title = input("\n请输入要查找的书名: ")
    result = bookshelf.find_book_by_title(search_title)
    print(result)


if __name__ == "__main__":
    main()